<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<link rel="stylesheet" type="text/css" href="../../avisynth.css">
   <title>ImageWriter Filter</title>
<!--
Automatically generated, don't change:
$Id: imagewriter.htm,v 1.9 2011/01/16 12:22:43 wilbertd Exp $
-->
</head>
<body>
<h2><a NAME="ImageWriter"></a>    ImageWriter
</h2>
<p><code>ImageWriter</code>(<var>clip, string &quot;file&quot;,
  int &quot;start&quot;, int &quot;end&quot;,
  string &quot;type&quot;, bool &quot;info&quot;</var>)

<p><code>ImageWriter</code> (present in limited form in <em>v2.51</em>, full
  functionality in <em>v2.52</em>) writes frames from a clip as images to your harddisk.

<p><var>file</var> default "c:\": is the path + filename prefix of the saved images.
  The images have filenames such as:
  <br>&nbsp;&nbsp;&nbsp;<tt>[path]000000.[type], [path]000001.[type], etc.</tt>

<p>In <em>v2.60</em> support for printf formating of filename is added. The default reflects the old behaviour (file="C:\%06d").<p><var>start</var> and <var>end</var>  are the start and end of the frame range that will be written. They both default to 0 (where ''end''=0 means last frame). If
<var>end</var> is negative (possible since <em>v2.58</em>), it specifies the number of frames that will be written.&nbsp;

<p><var>type</var> default "ebmp", is the filename extension and defines the
  format of the image.<br>The supported values for <var>type</var>, are:
<tt><br>&nbsp;&nbsp;(e)bmp, dds, ebmp, jpg/jpe/jpeg, pal, pcx, png,
    <br>&nbsp;&nbsp;pbm/pgm/ppm, raw, sgi/bw/rgb/rgba, tga, tif/tiff</tt>

<p><var>info</var> default false: optionally overlay text progress information
  on the output video clip, showing whether a file is being written, and if
  so, the filename (added in <em>v2.55</em>).

<p>Format "ebmp" supports all colorspaces (RGB24, RGB32, YUY2, YV12).&nbsp;
  The "ebmp" files written from RGB colorspaces are standard BMP files;
  those produced from YUV formats can probably only be read by AviSynth's
  <tt><code><a href="imagesource.htm">ImageReader/ImageSource</a></code></tt>.
  This pair of features allows you to save and reload raw video in any internal format.

<p>For all other formats the input colorspace<u> must be RGB24 or RGB32 (when
 the alpha channel is supported by the format and you want to include it).</u></p>
<p><b>Examples:</b>
<pre># Export the entire clip in the current native AviSynth format
ImageWriter(&quot;D:\backup-stills\myvideo&quot;)</pre>
<pre># Write frame 5 to &quot;C:\000005.PNG&quot;
ImageWriter(&quot;&quot;, 5, 5, &quot;png&quot;)</pre>
<pre># Write frames 100 till the end to &quot;F:\pic-000100.JPEG&quot;, &quot;F:\pic-000101.JPEG&quot;, etc.
# and display progress info
ImageWriter(file = &quot;F:\pic&quot;, start = 100, type = &quot;jpeg&quot;, info = true)</pre>
<pre># Write a jpg as greyscale (note the luma range should be [0,255], not [16,235])
ImageSource(&quot;F:\TestPics\GoldPetals.jpg&quot;)
ConvertToY8(matrix=&quot;PC.601&quot;)
ImageWriter(&quot;F:\TestPics\GoldPetals-8bit-avs&quot;, type = &quot;png&quot;)</pre>
<pre># Write a jpg as YV24 ebmp (note the luma range should be [0,255], not [16,235])
ImageSource(&quot;F:\TestPics\GoldPetals.jpg&quot;)
ConvertToYV24(matrix=&quot;PC.601&quot;)
ImageWriter(&quot;F:\TestPics\GoldPetals-24bit&quot;, type = &quot;ebmp&quot;)</pre>
<pre># Write all frames to &quot;F:\00.bmp&quot;, &quot;F:\01.bmp&quot;, ..., &quot;F:\10.bmp&quot;, &quot;F:\11.bmp&quot;, ..., &quot;F:\100.bmp&quot;, ... 
(thus adding zeros filling two digits)
ImageWriter(file=&quot;F:\%02d.bmp&quot;)</pre>
<p><b>Changelog:</b></p>
<table border="1" width="35%">
  <tr>
    <td width="5%">v2.58</td>
    <td width="95%">added end=-num_frames</td>
  </tr>
  <tr>
    <td width="5%">v2.60</td>
    <td width="95%">
      <ul>
        <li>ebmp supports all formats; greyscale added for all formats.</li>
        <li>add support for printf formating of filename string, default is
          (&quot;%06d.%s&quot;, n, ext).</li>
      </ul>
    </td>
  </tr>
</table>
<p><kbd>$Date: 2011/01/16 12:22:43 $</kbd></p>
<form><input TYPE="Button" VALUE="Back"
onClick="history.go(-1)"></form>
</body>
</html>
